package com.hfh.main.matrix.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Getter
@Setter
@Accessors(chain = true)
@TableName("col_week_matrix")
@Schema(name = "WeekMatrixEntity", description = "$!{table.comment}")
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class WeekMatrixEntity extends Model<WeekMatrixEntity> {

    @Schema(description = "主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @Schema(description = "爱啥啥")
    @TableField("week_number")
    private int weekNumber;

    @Schema(description = "爱啥啥")
    @TableField("user_acc")
    private String acc;

    @Schema(description = "爱啥啥")
    @TableField("user_identity")
    private String identity;

    @Schema(description = "爱啥啥")
    @TableField("week_score")
    private double weekScore;

    @Schema(description = "爱啥啥")
    @TableField("week_model_content")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String content;

    @Schema(description = "爱啥啥")
    @TableField("matrix1_score")
    private double matrix1Score;

    @Schema(description = "爱啥啥")
    @TableField("matrix2_score")
    private double matrix2Score;

    @Schema(description = "爱啥啥")
    @TableField("matrix3_score")
    private double matrix3Score;

    @Schema(description = "爱啥啥")
    @TableField("matrix4_score")
    private double matrix4Score;

    @Schema(description = "爱啥啥")
    @TableField("matrix5_score")
    private double matrix5Score;

    @Schema(description = "创建者")
    @TableField("create_by")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String createBy;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "创建时间")
    @TableField("create_time")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Date createTime;

    @Schema(description = "更新者")
    @TableField("update_by")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String updateBy;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "更新时间")
    @TableField("update_time")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Date updateTime;

    @Schema(description = "伪删除")
    @TableField("undock")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Integer undock;

    @Schema(description = "状态")
    @TableField("state")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Integer state;

    @Schema(description = "备注")
    @TableField("remark")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String remark;

    //字段补充
    @Schema(description = "爱啥啥")
    @TableField(exist = false)
    private String matrix1Name;

    @Schema(description = "爱啥啥")
    @TableField(exist = false)
    private String matrix2Name;

    @Schema(description = "爱啥啥")
    @TableField(exist = false)
    private String matrix3Name;

    @Schema(description = "爱啥啥")
    @TableField(exist = false)
    private String matrix4Name;

    @Schema(description = "爱啥啥")
    @TableField(exist = false)
    private String matrix5Name;

    @Schema(description = "爱啥啥")
    @TableField(exist = false)
    private List matrixNames = new ArrayList<String>();

    @Schema(description = "爱啥啥")
    @TableField(exist = false)
    private List matrixScores = new ArrayList<Double>();



    @Override
    public Serializable pkVal() {
        return this.id;
    }
}
